package 循环;

import java.util.Scanner;

public class demo17 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int sum=0;
        int sum1=0;
        for (int i=1;i<=30;i++){
            for (int j=1;j<=5;j++){
                System.out.println("请输入第"+i+"个学生的第"+j+"门成绩");
                int a=sc.nextInt();
                sum +=a;
            }
            System.out.println("是否继续（Y/N）");
            String b =sc.next();
            if (!b.equals("Y")){
                break;
            }
            sum1+=sum;
            System.out.println("学生的总成绩为"+sum1);
        }
    }
}
